<!doctype html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <meta name="viewport"
          content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>笔记编辑</title>
    <link rel="icon" th:href="@{/img/logo_zhongyj.png}"/>
    <link rel="stylesheet" href="https://unpkg.com/purecss@1.0.0/build/pure-min.css"
          integrity="sha384-nn4HPE8lTHyVtfCBi5yW9d20FjT8BJwUXyWZT9InLYax14RDjBj46LmSztkmNP9w"
          crossorigin="anonymous">
    <link rel="stylesheet" th:href="@{/note/css/note.css}">
    <link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.2.0/css/all.css"
          integrity="sha384-hWVjflwFxL6sNzntih27bfxkr27PmbbK/iSvJ+a4+0owXq79v+lsFkW54bOGbiDQ"
          crossorigin="anonymous">
    <!-- MarkDown编辑器 -->
    <link th:href="@{/admin/plugins/editormd/css/editormd.css}" rel="stylesheet"/>
    <link th:href="@{/admin/plugins/tagsinput/jquery.tagsinput.css}" rel="stylesheet"/>
    <link th:href="@{/admin/plugins/select2/select2.css}" rel="stylesheet"/>

    <!--<link rel="stylesheet" th:href="@{/admin/dist/css/font-awesome.min.css}">
    &lt;!&ndash; Ionicons &ndash;&gt;
    <link rel="stylesheet" th:href="@{/admin/dist/css/ionicons.min.css}">
    <link rel="stylesheet" th:href="@{/admin/dist/css/main.css}">
    <link rel="stylesheet" th:href="@{/admin/plugins/bootstrap/css/bootstrap.css}"/>
    <link rel="stylesheet" th:href="@{/admin/plugins/sweetalert/sweetalert.css}"/>
    <link rel="stylesheet" th:href="@{/admin/plugins/jqgrid-5.3.0/ui.jqgrid-bootstrap4.css}"/>
    &lt;!&ndash; Theme style &ndash;&gt;
    <link rel="stylesheet" th:href="@{/admin/dist/css/adminlte.min.css}">-->
</head>
<body>
<!-- 搜索框 -->
<form id="full-search">
    <label for="full-search-text"></label>
    <input type="text" id="full-search-text" placeholder="好记性不如烂键盘" name="search">
</form>

<div id="layout" class="content pure-g">
    <!-- 导航 -->
    <div th:replace="notes/note-aside::aside-nav"></div>

    <!-- 笔记详情列表 -->
    <div th:replace="notes/note-aside::aside-list"></div>

    <!-- 笔记内容 -->
    <div id="main" class="pure-u-1">
        <div class="note-content">
            <div class="note-content-header pure-g">
                <div class="pure-u-1-2">
                    <h1 class="note-content-title">Hello from Toronto</h1>
                    <p class="note-content-subtitle">
                        At <span th:id="${pageType}">3:56pm, April 3, 2012</span>
                    </p>
                </div>
                <div class="note-content-controls pure-u-1-2">
                    <button class="secondary-button pure-button" id="note-add"><a href="#">保存</a>
                    </button>
                </div>
            </div>

            <form method="post" action="">
                <div class="note-content-body">

                    <div class="card-header">
                        <h3 class="card-title">发布文章</h3>
                    </div>
                    <div class="form-group" style="display:flex;">
                        <label for="notebookId"></label>
                        <select class="form-control select2" style="width: 100%;"
                                id="blogCategoryId"
                                data-placeholder="请选择分类...">
                            <th:block th:if="${null == labelName}">
                                <option value="1" selected="selected">学习</option>
                            </th:block>
                            <th:block th:unless="${null == labelName}">
                                <th:block th:each="label : ${labelName}">
                                    <option th:value="${label}" th:text="${label}">
                                        学习
                                    </option>
                                </th:block>
                            </th:block>
                        </select> &nbsp;&nbsp;
                        <label for="blogCategoryId"></label>
                        <select class="form-control select2" style="width: 100%;"
                                id="notebookId"
                                data-placeholder="请选择笔记本...">
                            <th:block th:if="${null == notebookName}">
                                <option value="2" selected="selected">默认笔记本</option>
                            </th:block>
                            <th:block th:unless="${null == notebookName}">
                                <th:block th:each="notebook : ${notebookName}">
                                    <option th:value="${notebook.Id}"
                                            th:text="${notebook.notebookName}">
                                    </option>
                                </th:block>
                            </th:block>
                        </select>
                    </div>
                    <!-- 编辑器 -->
                    <div class="form-group" id="blog-editormd">
                        <label>
                            <textarea
                                    th:utext="${noteDetail!=null and noteDetail.noteContent !=null}?${noteDetail.noteContent}: ''"></textarea>
                        </label>
                    </div>
                </div>
            </form>
        </div>
    </div>
</div>

<!-- 移动设备底部导航，默认隐藏 -->
<nav th:replace="notes/note-aside::aside-mobile-bottom-nav"></nav>
</body>

<script src="https://yui-s.yahooapis.com/3.18.1/build/yui/yui-min.js"></script>
<script src="https://code.jquery.com/jquery-3.3.1.min.js"
        integrity="sha256-FgpCb/KJQlLNfOu91ta32o/NMZxltwRo8QtmkMRdAu8="
        crossorigin="anonymous"></script>
<script th:src="@{/note/js/note-index.js}"></script>

<!-- jQuery -->
<script th:src="@{/admin/plugins/jquery/jquery.min.js}"></script>
<!-- jQuery UI 1.11.4 -->
<script th:src="@{/admin/plugins/jQueryUI/jquery-ui.min.js}"></script>
<!-- Bootstrap 4 -->
<script th:src="@{/admin/plugins/bootstrap/js/bootstrap.bundle.min.js}"></script>
<!-- AdminLTE App -->
<script th:src="@{/admin/dist/js/adminlte.min.js}"></script>
<!-- editor.md -->
<script th:src="@{/admin/plugins/editormd/editormd.min.js}"></script>
<!-- tagsinput -->
<script th:src="@{/admin/plugins/tagsinput/jquery.tagsinput.min.js}"></script>
<!-- Select2 -->
<script th:src="@{/admin/plugins/select2/select2.full.min.js}"></script>
<!-- sweetalert -->
<script th:src="@{/admin/plugins/sweetalert/sweetalert.min.js}"></script>
<!-- ajaxupload -->
<script th:src="@{/admin/plugins/ajaxupload/ajaxupload.js}"></script>
<!-- editor.md 编辑器 -->
<script th:src="@{/admin/plugins/editormd/editormd.min.js}"></script>
<script th:src="@{/admin/dist/js/public.js}"></script>
<script th:src="@{/admin/dist/js/edit.js}"></script>
<script>
    YUI().use('node-base', 'node-event-delegate', function (Y) {

        let menuButton = Y.one('.nav-menu-button'),
            nav = Y.one('#nav');

        // Setting the active class name expands the menu vertically on small screens.
        menuButton.on('click', function () {
            nav.toggleClass('active');
        });

        // Your application code goes here...

    });

    $(function () {
        let pageType = $(".note-content-subtitle span").attr("id");
        if (pageType === "edit") {
            getDateTimeWeek();
        }
    });

    /**
     * 获取日期时间星期
     */
    function getDateTimeWeek() {
        let myDate = new Date();
        let year = myDate.getFullYear();    //获取完整的年份(4位,1970-????)
        let month = myDate.getMonth() + 1;       //获取当前月份(0-11,0代表1月)
        let date = myDate.getDate();        //获取当前日(1-31)
        let hours = myDate.getHours();//获取小时
        let minutes = myDate.getMinutes();//获取分
        let seconds = myDate.getSeconds();//获取秒
        //这些if判断是在小于10的时候前面自动补0
        if (month < 10) {
            month = '0' + month
        }
        if (date < 10) {
            date = '0' + date
        }
        if (hours < 10) {
            hours = '0' + hours
        }
        if (minutes < 10) {
            minutes = '0' + minutes
        }
        if (seconds < 10) {
            seconds = '0' + seconds
        }
        console.log(year + "-" + month + "-" + date + " " + hours + ":" + minutes + ":" + seconds);
        let str = "星期" + "日一二三四五六".charAt(new Date().getDay());
        console.log(str);
        $(".note-content-subtitle span").text(year + "-" + month + "-" + date + " " + hours + ":" + minutes + ":" + seconds + " " + str);
    }
</script>
</html>



















